<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
<style type="text/css">

span1{
 font-family:微软雅黑 ;
 font-size: 20px;
 color: white;
}
body{
 background-image: url("http://localhost:8080/my_term_project_xuanke/resource/image/adminchangePW.jpg");
 background-size: cover;
}
a {
 font-family:微软雅黑;
  color: yellow;
}
td{
margin-left: 30px;
font-family:黑体;
font-size: 20px;
color: white;
}
span2{
font-family:华文中宋;
font-size: 18px;
color: white;
}
.scbtn1{
font-family:黑体;
font-size: 16px;
text-align: center;
background-color: red;
border: 10px;
color: white;
padding: 5px 10px;
display: inline-block;
}
</style>
<meta charset="UTF-8">
<title>修改管理员密码</title>
<!-- 输入验证 -->
<script>
	function validateupdate(){
		var oldpwd=document.forms["updatePW"]["oldpwd"].value;
		var newpwd1=document.forms["updatePW"]["newPwd1"].value;
		var newpwd2=document.forms["updatePW"]["newPwd2"].value;
		if(oldpwd==""){
			 alert("请输入旧密码!");
	         return false;
		}
		if(oldpwd== newpwd2){
			alert("管理员先生，新旧密码是一样的");
	        return false;
		}
		
		if(newpwd1 != newpwd2){
			alert("两次密码输入不一致");
	        return false;
		}
	}
</script>
<!-- 处理反馈 -->
		<%
		 request.setCharacterEncoding("UTF-8");
		 String message=String.valueOf((request.getSession().getAttribute("update_message")));
		 %>
<script>
	var message="<%=message %>"
	if(message.length!=0&&message!="null"){
		alert(message);
		<%request.getSession().setAttribute("update_message","");%>
	}
	
</script>
<%	String ID=String.valueOf((request.getSession().getAttribute("ID"))); %>
<h1 align="center"><%=ID %>管理员修改密码</h1>
</head>
<body>
<div class="place">
    <span1>修改密码</span1>
    <ul class="placeul">
    <li ><a href="http://localhost:8080/my_term_project_xuanke/admin/admin_home.jsp">继续选课</a></li>
    </ul>
    </div>  
	    <div>
	    <form method="POST" name="updatePW" onsubmit="return validateupdate()" action="http://localhost:8080/my_term_project_xuanke/adminServlet?action=updatePW"><!--  -->
		    
		    <table>
		    	<tr><td>&nbsp;&nbsp;&nbsp;旧 密 码</td><td><input name="oldpwd" placeholder="请输入原密码" type="text" class="dfinput" /></td></tr>
			    <tr><td>&nbsp;&nbsp;&nbsp;新 密 码</td><td><input name="newPwd1" placeholder="请输入新密码" type="password" class="dfinput" /></td></tr>
			    <tr><td>&nbsp;&nbsp;&nbsp;确&nbsp;&nbsp;&nbsp;认 	</td><td><input name="newPwd2" placeholder="确认新密码" type="password" class="dfinput" /></td></tr>    	 
		        <tr><td>&nbsp;&nbsp;&nbsp;<input name="" type="submit" class="scbtn1" value="修改密码" onclick="validateupdate()"/></td>
			   		<td>&nbsp;&nbsp;&nbsp; <input name="" type="reset" class="scbtn1" value="重置" onclick="validateupdate()"/></td></tr>
		    </table>	
		  	    	
			
		    
		    </form>
		    </div>
		    
	    <span2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;开发人员联系方式：1111111111</span2>

</body>
</html>